package com.example.oracleviewer.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;

/**
 * 用户卡片实体类，映射sync_usercard_all视图
 */
@Data
@Entity
@Table(name = "sync_usercard_all")
public class UserCard {


    @Column(name = "USERID")
    private String userId;

    @Column(name = "USERNAME")
    private String username; // 人员姓名，可选
    @Id // 人员主键，必填
    @Column(name = "USERNUMB")
    private String userNumb; // 人员编号，必填，编号唯一

    @Column(name = "SEX")
    private Integer sex; // 人员性别，可选：0-未知, 1-男, 2-女

    @Column(name = "DEPTNAME")
    private String deptName; // 部门名称，可选

    @Column(name = "CATEGORY")
    private Integer category; // 人员类型，可选，第三方定义

    @Column(name = "USERSTATUS")
    private Integer userStatus; // 人员状态，必填：0-正常, 1-注销

    @Column(name = "CARDNO")
    private Integer cardNo; // 卡流水号，可选

    @Column(name = "FACTORYFIXID")
    private String factoryFixId; // 物理卡号，必填

    @Column(name = "CARDSTATUS")
    private Integer cardStatus; // 卡状态，必填：1-正常, 2-挂失, 3-无卡, 4-退卡, 7-冻结

    @Column(name = "CREATETIME")
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime; // 创建时间，必填

    @Column(name = "UPDATETIME")
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime; // 更新时间，必填
} 